﻿using IdentityServer4.Models;
using IdentityServer4.Services;
using System.Linq;
using System.Threading.Tasks;

namespace IdentityServiceForUserInfo
{
    public class ProfileService : IProfileService
    {
        public async Task GetProfileDataAsync(ProfileDataRequestContext context)
        {
            await Task.Run(() => {
                var claims = context.Subject.Claims.ToList();
                context.IssuedClaims = claims.ToList();
            });
            
        }

        public async Task IsActiveAsync(IsActiveContext context)
        {
            await Task.Run(() => { context.IsActive = true; });
        }
    }
}
